package sell;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

public class Goods implements Serializable {
    private Integer id;
    private Double price;
    private Date date;

    public Goods(Integer id, Double price, Date date) {
        this.id = id;
        this.price = price;
        this.date = date;
    }

    public Goods() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "id=" + id +
                ", price=" + price +
                ", date=" + date +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Goods goods = (Goods) o;
        return Objects.equals(id, goods.id) && Objects.equals(price, goods.price) && Objects.equals(date, goods.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, price, date);
    }
}
